Skip to content

GDScript: Initialize language when generating test output#117821

Open
HolonProduction wants to merge 1 commit intogodotengine:masterfrom
HolonProduction:gdscript/generate-tests-init
Open

GDScript: Initialize language when generating test output#117821
HolonProduction wants to merge 1 commit intogodotengine:masterfrom
HolonProduction:gdscript/generate-tests-init

Conversation

@HolonProduction
Copy link
Copy Markdown
Member

@HolonProduction HolonProduction commented Mar 25, 2026

#116938 adds a test which uses a non relative path. This works when running the tests, however when generating output this would fail, because we do not initialize the language in the same way when generating tests.

The reason for that, is that the cmd option for generating tests is handled in the language initialization. So if we tried to init the language when generating tests we would run into an infinite recursion.

This PR moves the entrypoint for generating test output to use REGISTER_TEST_COMMAND, so we can always run the language initialization.

As a result the cmd option changed from --gdscript-generate-tests to --test gdscript-generate-tests. This only effects developers, I also added an error message when using the old option. So I don't consider this compat breaking.

Accompanying docs PR: godotengine/godot-docs#11874

@HolonProduction HolonProduction force-pushed the gdscript/generate-tests-init branch from 86ef753 to ebb97f5 Compare March 25, 2026 11:53
youfch added a commit to youfch/godot that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants